#ifndef AST_EXTERNAL_DECLARATION_H
#define AST_EXTERNAL_DECLARATION_H
#include "../ASTNode.h"


class FunctionDefinition;
class Declaration;

/*
(C99 6.9)
external-declaration:
		function-declaration
		translation-unit	external-declaration
*/
class ExternalDeclaration : public ASTNode
{
protected:
	ExternalDeclaration()
		:ASTNode(ASTNode::external_declaration){};
public:
	explicit ExternalDeclaration(FunctionDefinition *pFunction)
		:ASTNode(ASTNode::external_declaration), m_bIsFunction(true), m_pFunction(pFunction){};

	explicit ExternalDeclaration(Declaration *pDeclaration)
		:ASTNode(ASTNode::external_declaration),  m_bIsFunction(false), m_pDeclaration(pDeclaration){};
	
	virtual ~ExternalDeclaration();
	
	virtual void 			codeGen();

protected:
	bool						m_bIsFunction;
	union{
		FunctionDefinition *				m_pFunction;
		Declaration	*						m_pDeclaration;
	};
};



#endif


